cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
cmake_policy(SET CMP0054 NEW)

set(CMAKE_CXX_STANDARD 17)

set(PROJECT_VERSION 0.2.0)
project(SV2ArucoDet VERSION ${PROJECT_VERSION} LANGUAGES CXX)

add_definitions(-DAPI_EXPORTS)
set(CMAKE_BUILD_TYPE "Release")


find_package(SpireMS REQUIRED)
find_package(OpenCV 4 REQUIRED)
message(STATUS "OpenCV library status:")
message(STATUS "    version: ${OpenCV_VERSION}")
message(STATUS "    libraries: ${OpenCV_LIBS}")
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")


include_directories(${SpireMS_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})


# Public header
set(HEADS
  sv2_aruco_det.h
)

set(SRCS
  sv2_aruco_det.cpp
)


# add_library(sv2_aruco_det SHARED ${SRCS})
# target_link_libraries(sv2_aruco_det ${OpenCV_LIBS} ${SpireMS_LIBS})

# Demo
add_executable(SV2ArucoDetDemo aruco_det_demo.cpp ${SRCS})
target_link_libraries(SV2ArucoDetDemo ${OpenCV_LIBS} ${SpireMS_LIBS})

add_executable(SV2FEIPadDetDemo feipad_det_demo.cpp ${SRCS})
target_link_libraries(SV2FEIPadDetDemo ${OpenCV_LIBS} ${SpireMS_LIBS})


install(TARGETS SV2ArucoDetDemo SV2FEIPadDetDemo
  RUNTIME DESTINATION bin
)

